//
//  BarCodeController.h
//  BarCode
//
//  Created by Hunk on 12-2-7.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ZBarSDK.h"

@protocol BarCodeControllerDelegate;
@protocol BarCodeControllerDataSource;
@interface BarCodeController : NSObject<ZBarReaderDelegate>
{
    ZBarReaderViewController        *zbarReaderViewController;
    
    id<BarCodeControllerDelegate>   _delegate;
    id<BarCodeControllerDataSource> _dataSource;
    
    UIViewController                *_viewController;
}
@property (nonatomic, assign) id<BarCodeControllerDelegate>   delegate;
@property (nonatomic, assign) id<BarCodeControllerDataSource> dataSource;

- (void)scanBarCodeOnViewController:(UIViewController *)viewController;

- (void)cancelScanBarCode;

@end

@protocol BarCodeControllerDelegate <NSObject>
@required
- (void) didFinishScan:(BarCodeController *)barCodeContoller result:(NSString *)result image:(UIImage *)image;
@end

@protocol BarCodeControllerDataSource <NSObject>
@optional
- (UIView *)barCodeOverlayView:(BarCodeController *)barCodeContoller;
@end
